3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D provides routines for accessing various object types. The types are defined as follows:
typedef struct TQ3ObjectClassPrivate *TQ3XObjectClass;
You can use the Q3XObjectClass_GetType function to get the type, given a reference to a class. This is most useful in the instance where you register an element or attribute and need to get the type. When you register an element, QuickDraw 3D will take the type you pass in and modify it, to avoid name conflicts. Many object system calls require an object type; this function lets you get the type from the class reference that you ordinarily store when you register a class.
TQ3Status Q3XObjectClass_GetType(
TQ3XObjectClass objectClass,
TQ3ObjectType *type);
The Q3XObjectClass_GetLeafType function lets you determine the leaf type of a class.
TQ3ObjectType Q3XObjectClass_GetLeafType(
TQX3ObjectClass objectClass);
The Q3XObjectClass_GetSubClassType function lets you determine the subclass type of one object class relative to another object class.
TQ3ObjectType Q3XObjectClass_GetSubClassType(
TQX3ObjectClass objectClass,
TQX3ObjectClass targetObjectClass);
The Q3XObjectClass_GetSubClassType function is used for _GetType calls in a particular class. For example, Q3Geometry_GetType would be implemented
TQ3ObjectType Q3Geometry_GetType (TQ3GeometryObject object)
{
return Q3XObject_GetSubClassType (gGeometryClass, object);
}
where gGeometryClass is the geometry object class, and object is a subclass of the geometry class. The type returned is the subclass type of the geometry.
If an error occurs, the Q3XObjectClass_GetSubClassType function returns kQ3ObjectTypeInvalid and posts an error.
You can use the Q3XObject_GetClass function to get the class of an object.
TQ3XObjectClass Q3XObject_GetClass(
TQ3Object object);
The Q3XObject_GetSubClassType function lets you determine the subclass type of an object relative to an object class.
TQ3ObjectType Q3XObject_GetSubClassType(
TQ3XObjectClass objectClass,
TQ3XObject targetObject);
Use of Q3XObject_GetSubClassType resembles Q3XObjectClass_GetSubClassType (link) , except it is used for an object relative to an object class instead of for two object classes.
Previous | QD3D Book | Overview | Chapter Contents | Next |